Skip to content

Conversation

@PeerInfinity
Copy link
Contributor

No description provided.

PeerInfinity and others added 11 commits December 20, 2025 12:07
This commit adds comprehensive ActionScript 2.0 object and function support:

Object System (new files):
- object.h/object.c: ASObject and ASArray with reference counting
- Property management with ECMA-262 compliant attribute flags
- Interface support for ActionScript 2.0 implements keyword

ActionScript Opcodes (action.c):
- Object opcodes: NewObject, InitObject, TypeOf, InstanceOf, Enumerate, Enumerate2
- Array opcodes: InitArray
- Function opcodes: DefineFunction, DefineFunction2, CallFunction, CallMethod
- Member access: GetMember, SetMember, DeleteMember
- Stack operations: StackSwap, PushDuplicate
- Comparison: Equals2, StrictEquals, Greater, Less2
- String operations: StringAdd, StringLength, StringExtract, MBStringLength
- Type conversion: ToNumber, ToString, ToInteger
- Built-in functions: trace(), getTimer(), random(), etc.

Heap Refactoring:
- All heap functions now require app_context parameter
- HALLOC/FREE/HCALLOC macros for convenient allocation
- Virtual memory-based allocation with lazy physical commit
- Proper initialization order: heap_init before flashbang_init

SWFAppContext Enhancements:
- Added heap_inited, heap_full_size, heap_current_size fields
- Added frame_count, is_playing, is_dragging, dragged_target
- NO_GRAPHICS guards for graphics-specific fields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore tabs on blank lines and remove trailing whitespace to match
upstream's code style conventions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Revert ActionVar struct to upstream anonymous union API
- Revert variables.c to use HALLOC and app_context parameters
- Revert heap.h/heap.c to simpler upstream implementation
- Add heap_calloc for zeroed memory allocation
- Stub MovieClip-related functions not in SWFRecomp's minimal opcode set:
  actionTargetPath, actionPlay, actionEndDrag, actionSetTarget2,
  actionGetProperty, actionSetProperty, actionSetTarget, actionStartDrag,
  actionWaitForFrame, actionWaitForFrame2
- Fix function signatures to match reverted API:
  getVariable, setVariableWithValue, materializeStringList
- Keep object/function opcode implementations needed by SWFRecomp

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restores bitmap_count guards and original shader configuration.
These changes were not related to object/function support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove actionCloneSprite and actionRemoveSprite which were defined
but never called. These functions are not needed by SWFRecomp.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reverted swf.h to upstream (whitespace-only diff)
- Fixed remaining whitespace issues in action.c

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed section comments that were added to existing upstream code.
Simplifies the diff while keeping only the new function declarations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep semicolons in macros to match upstream style.
Restore trailing whitespace to match upstream exactly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove implementations for arithmetic, comparison, string, bitwise,
exception handling, and other non-essential opcodes. Keep only:
- Object: GetMember, SetMember, NewObject, InitObject, Delete, etc.
- Array: InitArray
- Function: DefineFunction, DefineFunction2, CallFunction, CallMethod
- Stack/Register: StoreRegister, PushRegister

Reduces action.c from ~6000 to ~3000 lines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Re-adds the following action functions from upstream:
- Arithmetic: actionAdd, actionSubtract, actionMultiply, actionDivide
- Comparison: actionEquals, actionLess, actionAnd, actionOr, actionNot
- String: actionStringEquals, actionStringLength, actionStringAdd
- Variables: actionGetVariable, actionSetVariable
- Utility: actionTrace, actionGetTime

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant